package lawyer.controller;

import lawyer.Service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.config.Task;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/lawyer/tasks")
public class TaskController {

    @Autowired
    private TaskService taskService;

    @GetMapping("/processing")
    public ResponseEntity<List<Task>> getProcessingTasks(@RequestParam Long lawyerId) {
        return ResponseEntity.ok(taskService.getProcessingTasks(lawyerId));
    }

    @GetMapping("/assigned")
    public ResponseEntity<List<Task>> getAssignedTasks(@RequestParam Long lawyerId) {
        return ResponseEntity.ok(taskService.getAssignedTasks(lawyerId));
    }

    @GetMapping("/available")
    public ResponseEntity<List<Task>> getAvailableTasks() {
        return ResponseEntity.ok(taskService.getAvailableTasks());
    }
}